package liu;

/**
 * Created by mc on 2016/7/27.
 */
import java.util.Arrays;
public class shiyi {
    private Object[] list;
    private int next;
    public shiyi(int capacity){
        list = new Object[capacity];
        return;
    }
    public shiyi(){
        this(16);
    }
    public void add(Object o){
        if(next==list.length){
            list = Arrays.copyOf(list, list.length*2);
        }
        list[next++] = o;
    }
    public Object get(int index){
        return list[index];
    }
    public int size(){
        return next;
    }
}

